<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCreditsLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('credits_log', function (Blueprint $table) {
            $table->increments('credit_log_id')->comment('主键');
            $table->integer('user_id')->comment('用户ID');
            $table->integer('rule_id')->comment('规则ID');
            $table->string('rule_name', 20)->comment('规则名称');
            $table->integer('cycle_times')->comment('已执行次数');
            $table->integer('history_times')->comment('历史执行次数');
            $table->integer('credits')->comment('历史增加积分数');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('credits_log');
    }
}
